<% layout('/layout/default.html', {title: '生成方案管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa fa-cubes"></i> 生成方案管理
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="查询"><i class="fa fa-filter"></i> 查询</a>
				<% if(hasPermi('gen:genScheme:edit')){ %>
					<a href="/gen/genScheme/form" class="btn btn-default btnTool"  title="新增生成方案"><i class="fa fa-plus"></i> 新增</a>
				<% } %>
			</div>
		</div>
		<div class="box-body">
			<form id="searchForm" action="${ctx}/gen/genScheme/listData" method="post" class="form-inline hide" >
				<div class="form-group">
					<label class="control-label">方案名称 ：</label>
					<div class="control-inline">
						<input name="name" maxlength="50" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">查询</button>
					<button type="reset" class="btn btn-default btn-sm">重置</button>
				</div>
				
			</form>			
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
//初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'方案名称', name:'name', index:'a.name', width:90, align:"center"},
		{header:'生成模块', name:'packageName', index:'a.package_name', width:140, align:"center"},
		{header:'模块名', name:'moduleName', index:'a.module_name', width:120, align:"center", formatter: function(val, obj, row, act){
			var modName = row.moduleName;
			if(row.subModuleName)
				modName += ("."+row.subModuleName);
			return modName;
		}},
		{header:'功能名', name:'functionName', index:'a.function_name', width:100, align:"center"},
		{header:'功能作者', name:'functionAuthor', index:'a.function_author', width:100, align:"center"},
		{header:'操作', name:'actions', width:100, sortable:false, title:false, align:"center",formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('gen:genScheme:edit')){ %>
				actions.push('<a href="/gen/genScheme/form?id='+row.id+'" class="btnList" title="编辑生成方案"><i class="fa fa-pencil"></i></a>&nbsp;');
			<% } %>
			<% if(hasPermi('gen:genScheme:edit')){ %>
				actions.push('<a href="${ctx}/gen/genScheme/delete?id='+row.id+'" class="btnList" title="删除生成方案" data-confirm="确认要删除该生成方案吗？"><i class="fa fa-trash-o"></i></a>&nbsp;');
			<% } %>
			
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});

</script>